<html>
<title>test</title>
<body>
</body>
<script>
  var img = new Image();

  img.onload = function() {
    var detector = new BarcodeDetector();

    detector.detect(img)
      .then(detectedObjects => {
        if (detectedObjects.length)
          document.title = detectedObjects[0].rawValue;
        else
          document.title = 'found no shapes';
      })
      .catch(error => {
        document.title = 'Error during detection: ' + error.message;
      });
  }

  // "https://chromium.org" encoded as QR code in base64
  img.src = '';
</script>
</html>
